#-*- encoding:utf-8 -*-

def titleToNumber(s):
    """
    :type s: str
    :rtype: int
    """ 
    res = 0	
    if s is None:
    	return 
    carry = len(s) - 1
    for i in s:
    	res = res + 26**carry*(ord(i) - 64) 
        carry -=1
    return res

print titleToNumber('')